Issue 168: add grid to enum schema workflow#184
Conversation
|
Warning Review limit reached
More reviews will be available in 58 minutes and 42 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (31)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 23e1f02396
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Greptile SummaryThis PR introduces a Grid to Enum Schema workflow: clicking the new toolbar button scans the live grid, prompts for an enum-value cap, optionally confirms truncation, and replaces the schema definition with one enum row per column. It also adds a shared
Confidence Score: 5/5Safe to merge — all critical paths are correctly handled and covered by tests. The new workflow is well-isolated, cleans up in a finally block, and delegates schema mutation through an existing validated API. The enum round-trip through buildRuleSpecFromSchemaRow and extractAwdEnumValues is correct for all serialised value shapes. test-data-grid-controller.test.js contains a dead-code mount in one test; test-data-grid-controller.js performs an unnecessary row construction on the initial grid probe. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Button as Grid to Enum Schema Button
participant Controller as TestDataGridController
participant Grid as Main Grid
participant TextInputDialog
participant ConfirmDialog
participant SchemaEditor
User->>Button: click
Button->>Controller: onGenerateSchemaFromGrid()
Controller->>Controller: setGenerateSchemaBusy(true)
Controller->>Grid: getGridAsGenericDataTable()
Grid-->>Controller: dataTable
Controller->>Controller: buildGridEnumSchemaSummary (initial probe)
alt no usable columns
Controller-->>User: status warning, return false
else usable columns found
Controller->>TextInputDialog: requestTextInput (limit prompt)
User-->>TextInputDialog: enter limit or cancel
TextInputDialog-->>Controller: limit string or null
alt cancelled
Controller-->>User: status warning, return false
else limit entered
Controller->>Controller: createEnumSchemaRowsFromGrid (with limit)
alt truncation needed
Controller->>ConfirmDialog: requestConfirm
User-->>ConfirmDialog: confirm or cancel
ConfirmDialog-->>Controller: boolean
end
Controller->>SchemaEditor: replaceSchemaRows(rows)
SchemaEditor-->>Controller: validation result
Controller-->>User: status success
end
end
Controller->>Controller: setGenerateSchemaBusy(false) [finally]
Reviews (2): Last reviewed commit: "Address enum schema review feedback" | Re-trigger Greptile |
There was a problem hiding this comment.
Pull request overview
Adds a new “Grid to Enum Schema” workflow to the Test Data panel, allowing users to scan the current editable grid and replace the schema definition with enum-only rows derived from visible column values. This fits into the existing test-data generation UX by providing a faster path from “example data in grid” → “reusable enum schema” with truncation confirmation and updated documentation/tests.
Changes:
- Introduces grid scanning + enum-schema row derivation, with a numeric limit prompt and optional truncation confirmation.
- Adds a shared schema replacement API (
replaceRows) and wires it through the schema definition/editor components. - Expands unit/component/browser test coverage and documents the workflow in Docusaurus.
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core-ui/src/tests/utils/modal-text-input.test.js | Adds coverage for optional message/label + numeric input configuration in the text input dialog. |
| packages/core-ui/src/tests/shared/shared-schema-definition-view.test.js | Verifies schema row replacement rerenders and refreshes text-mode output. |
| packages/core-ui/src/tests/shared/dialog-services.test.js | Updates dialog service test to cover message/label and numeric input attributes. |
| packages/core-ui/src/tests/grid/schema/grid-to-enum-schema.test.js | Adds unit tests for enum-limit normalization and enum row creation from grid data. |
| packages/core-ui/src/tests/grid/controller/test-data-grid-controller.test.js | Adds controller-level tests for “Grid to Enum Schema” flow, including truncation confirmation and 256 cap. |
| packages/core-ui/src/tests/app/test-data-population-toolbar.test.js | Ensures toolbar renders and disables the new action appropriately and emits callbacks. |
| packages/core-ui/src/tests/app/population-actions.test.js | Ensures new action button + help affordance renders and emits clicks; covers busy state. |
| packages/core-ui/src/tests/app/data-population-panel.test.js | Wires new callback through panel and validates schema replacement delegation. |
| packages/core-ui/js/gui_components/shared/test-data/schema/shared-schema-editor-controller.js | Adds replaceRows implementation to reset/validate/rerender/sync when replacing schema rows. |
| packages/core-ui/js/gui_components/shared/schema-definition/shared-schema-definition-controller.js | Exposes replaceRows on the schema definition controller. |
| packages/core-ui/js/gui_components/shared/schema-definition/index.js | Exposes replaceRows on the schema definition component API. |
| packages/core-ui/js/gui_components/shared/modal-text-input.js | Extends text input modal to support optional message/label and numeric field configuration. |
| packages/core-ui/js/gui_components/app/test-data-population-toolbar/test-data-population-toolbar-view.js | Adds UI wiring/props for the new action + help text and busy flag propagation. |
| packages/core-ui/js/gui_components/app/test-data-population-toolbar/test-data-population-toolbar-controller.js | Tracks generateSchemaBusy state for the toolbar. |
| packages/core-ui/js/gui_components/app/test-data-population-toolbar/index.js | Adds setGenerateSchemaBusy component API for the toolbar. |
| packages/core-ui/js/gui_components/app/test-data-grid/schema/grid-to-enum-schema.js | New implementation to summarize unique grid values and generate enum schema rows. |
| packages/core-ui/js/gui_components/app/test-data-grid/controller/test-data-grid-controller.js | Adds the controller workflow to prompt for limit, confirm truncation, and replace schema rows. |
| packages/core-ui/js/gui_components/app/population-actions/population-actions-view.js | Renders the new action button + help, wires click handler, and applies busy state. |
| packages/core-ui/js/gui_components/app/population-actions/population-actions-controller.js | Adds state + callback handler for “Grid to Enum Schema”. |
| packages/core-ui/js/gui_components/app/population-actions/index.js | Adds setGenerateSchemaBusy component API for population actions. |
| packages/core-ui/js/gui_components/app/data-population-panel/index.js | Adds panel API for setGenerateSchemaBusy and replaceSchemaRows. |
| packages/core-ui/js/gui_components/app/data-population-panel/data-population-panel-view.js | Passes new callback and busy flag down into the toolbar/actions. |
| packages/core-ui/js/gui_components/app/data-population-panel/data-population-panel-controller.js | Tracks generateSchemaBusy state for the panel. |
| docs-src/docs/040-test-data/015-data-grid-editable.md | Documents the new “Grid to Enum Schema” workflow and behavior. |
| apps/web/src/tests/browser/app/functional/test-data/grid-to-enum-schema.spec.js | Adds Playwright functional coverage for schema creation and truncation confirmation. |
| apps/web/src/tests/browser/app/abstractions/components/text-input-dialog.component.js | Updates page object to work with non-textbox inputs and customizable submit button label. |
| apps/web/src/tests/browser/app/abstractions/components/test-data-panel.component.js | Adds page-object APIs to open/submit the new dialog; wires confirm/text-input components. |
| apps/web/src/tests/browser/app/abstractions/components/confirm-dialog.component.js | Allows specifying confirm button label (needed for truncation confirm). |
| apps/web/src/stories/test-data-population-toolbar.stories.js | Updates Storybook to include the new action and busy prop. |
| apps/web/src/stories/population-actions.stories.js | Updates Storybook to show the new action and event wiring. |
Summary
Grid to Enum Schemaworkflow that derives enum schema rows from the live gridTesting